package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Focus;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface FocusMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Focus record);

    Focus selectByPrimaryKey(Long id);

    List<Focus> selectAll();

    int updateByPrimaryKey(Focus record);

    /**
     * 根据关注人和被关注人的id查询关注对象
     *
     * @param focusId
     * @param focusedId
     * @return
     */
    Focus selectByFocusIdAndFocusedId(@Param("focusId") Long focusId, @Param("focusedId") Long focusedId);

    /**
     * 统计粉丝数
     *
     * @param focusId
     * @return
     */
    Integer getFocusCount(Long focusId);

    /**
     * 统计自身关注数
     *
     * @param focusId
     * @return
     */
    Integer getFocusedCount(Long focusId);

    /**
     * 取消关注的接口
     * @param focusId
     * @param focusedId
     */
    void deleteFocus(@Param("focusId") Long focusId, @Param("focusedId") Long focusedId);
}